package com.sinevil.tcpTrans.utils.fileTrans.entity;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Objects;

/**
 * @Classname FilePacketRequestInfo
 * @Description TODO
 * @Version 1.0.0
 * @Date 2025/1/7 15:09
 * @Created by sinevil
 */
@Data
@AllArgsConstructor
public class FilePacketRequestInfo {
    public String uid;
    public long offset;
    public int size;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass()!= o.getClass()) return false;
        FilePacketRequestInfo f = (FilePacketRequestInfo) o;
        return offset == f.offset && size == f.size && uid.equals(f.uid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(uid, offset,size);
    }

    public String toInstructionContent() {
        // TODO
        return "UID(" + uid + ")," +
                "offset(" + offset + ")," +
                "size(" + size + ")";
    }
}